//
//	ZcoModelSchedPolicy.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelSchedPolicy.h"

NSString *const kZcoModelSchedPolicyCustomizedPolicy = @"customizedPolicy";
NSString *const kZcoModelSchedPolicyDefaultPolicy = @"defaultPolicy";

@interface ZcoModelSchedPolicy ()
@end
@implementation ZcoModelSchedPolicy




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelSchedPolicyCustomizedPolicy] isKindOfClass:[NSNull class]]){
		self.customizedPolicy = dictionary[kZcoModelSchedPolicyCustomizedPolicy];
	}	
	if(![dictionary[kZcoModelSchedPolicyDefaultPolicy] isKindOfClass:[NSNull class]]){
		self.defaultPolicy = dictionary[kZcoModelSchedPolicyDefaultPolicy];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.customizedPolicy != nil){
		dictionary[kZcoModelSchedPolicyCustomizedPolicy] = self.customizedPolicy;
	}
	if(self.defaultPolicy != nil){
		dictionary[kZcoModelSchedPolicyDefaultPolicy] = self.defaultPolicy;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.customizedPolicy != nil){
		[aCoder encodeObject:self.customizedPolicy forKey:kZcoModelSchedPolicyCustomizedPolicy];
	}
	if(self.defaultPolicy != nil){
		[aCoder encodeObject:self.defaultPolicy forKey:kZcoModelSchedPolicyDefaultPolicy];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.customizedPolicy = [aDecoder decodeObjectForKey:kZcoModelSchedPolicyCustomizedPolicy];
	self.defaultPolicy = [aDecoder decodeObjectForKey:kZcoModelSchedPolicyDefaultPolicy];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelSchedPolicy *copy = [ZcoModelSchedPolicy new];

	copy.customizedPolicy = [self.customizedPolicy copy];
	copy.defaultPolicy = [self.defaultPolicy copy];

	return copy;
}
@end